﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace PJOnimal
{
    public class GameSceneManager
    {
        public Man1 man1;
        public Man2 man2;
        public SelectCharacter select;
        public ManEnd end;

        public List<GameScene> listCacMan = new List<GameScene>();

        public GameSceneManager(Onimal game)
        {
            man1 = new Man1(game);
            man2 = new Man2(game);
            select = new SelectCharacter(game);
            end = new ManEnd(game);

            listCacMan.Add(man1);
            listCacMan.Add(man2);
            listCacMan.Add(select);
            listCacMan.Add(end);

            man1.hoatDong = true; //mặc định màn mở đầu cho game            
        }

        public void ChuyenMan(GameScene tuMan, GameScene sangMan)
        {
            tuMan.hoatDong = false;
            sangMan.hoatDong = true;
        }

        public void Update(GameTime gameTime)
        {
            foreach (GameScene man in listCacMan)
            {   
                if(man.hoatDong)
                    man.Update(gameTime);
            }

        }

        public void Draw(SpriteBatch spriteBatch)
        {
            foreach (GameScene man in listCacMan)
            {
               if(man.hoatDong)
                    man.Draw(spriteBatch);
            }
        }
    }
}
